package com.chance.cc.crawler.development.command.publish.vm;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.realtime.DcdappWebForumRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.realtime.DcdappWebPraiseRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.simple.DcdappWebForumSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.simple.DcdappWebPraiseSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.trace.DcdappWebForumTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.vm.dcdapp.trace.DcdappWebPraiseTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.domain.vm.realtime.RealtimeCronCrawlerTriggerInfo;
import com.chance.cc.crawler.development.command.trigger.domain.vm.realtime.RealtimeSimpleCrawlerTriggerInfo;
import com.chance.cc.crawler.development.command.trigger.domain.vm.trace.TraceCronCrawlerTriggerInfo;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2021/3/3 12:58
 * @Description
 *      懂车帝 发布任务
 **/
public class PublishDcdappCrawlerJob {
    private static final String domain = "dcdapp";

    public static void main(String[] args) {
//        publishForumSimpleJob();
        publishPraiseSimpleJob();

//        publishForumRealtimeCronJob();
//        publishPraiseRealtimeCronJob();
//        publishForumTraceCronJob();
//        publishPraiseTraceCronJob();

//        DcdappPublishScript.publishCrawlerNodeScript();
    }

    /**
     * 懂车帝问答单次调度
     */
    public static void publishForumSimpleJob(){
        String node = "懂车帝问答";
        CrawlerJob crawlerJob = DcdappWebForumSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeSimpleCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 懂车帝口碑单次调度
     */
    public static void publishPraiseSimpleJob(){
        String node = "懂车帝口碑";
        CrawlerJob crawlerJob = DcdappWebPraiseSimpleCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeSimpleCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 懂车帝问答定时调度
     */
    public static void publishForumRealtimeCronJob(){
        String node = "懂车帝问答";
        CrawlerJob crawlerJob = DcdappWebForumRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeCronCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 懂车帝口定时调度
     */
    public static void publishPraiseRealtimeCronJob(){
        String node = "懂车帝口碑";
        CrawlerJob crawlerJob = DcdappWebPraiseRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        RealtimeCronCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 懂车帝问答7天回溯调度
     */
    public static void publishForumTraceCronJob(){
        String node = "懂车帝问答";
        CrawlerJob crawlerJob = DcdappWebForumTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        TraceCronCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

    /**
     * 懂车帝问答7天回溯调度
     */
    public static void publishPraiseTraceCronJob(){
        String node = "懂车帝口碑";
        CrawlerJob crawlerJob = DcdappWebPraiseTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        TraceCronCrawlerTriggerInfo.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey(),domain,node);
    }

}
